package com.youlai.eng.common;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import java.io.Serializable;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.Date;

@Data
public class BaseJpaEntity implements Serializable {
    @Transient
    private static final long serialVersionUID = 1L;

    @Schema(description ="排序")
    private Integer sort;

    @Schema(description ="状态(1:正常;0:禁用)")
    private Integer status;

    @Schema(description ="备注")
    private String remark;

    @Schema(description ="逻辑删除标识(0:未删除;1:已删除)")
    private Integer deleted;

    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;

    private Long createBy;

    private String createName;

    private Long updateBy;

    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @LastModifiedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;

    private String updateName;
}
